package com.twu.biblioteca;

import java.util.ArrayList;

public class Authenticator {
    ArrayList<Customer> users;
    private Customer currentUser = null;

    public Authenticator(ArrayList<Customer> users){
        this.users = users;
    }

    public boolean login(String userNum, String password) {
        for(Customer user : users){
            if(user.libNumber().equals(userNum) && user.password().equals(password)){
                currentUser = user;
                return true;
            }
        }
        return false;
    }

    public Customer currentUser() {
        return currentUser;
    }
}
